package projecteuler;

import java.util.ArrayList;

public class Problem48
{
    public static void main(String[] args)
    {
        long now = System.currentTimeMillis();   
        ArrayList<String> total = new ArrayList<String>();
        total.add("1");
        int limit = 1000;
        for (int i = 2; i <= limit; i++)
        {
            System.out.println(i + ": " + (System.currentTimeMillis() - now) +"ms");
            ArrayList<String> currentNum = new ArrayList<String>();
            String tempNum = String.valueOf(i);
            for (int j = tempNum.length() - 1; j >=0 ; j--)
            {
                currentNum.add(String.valueOf(tempNum.charAt(j)));
            }
            ArrayList<String> currentExp = Utils.power(currentNum, i);
            total = Utils.add(total, currentExp);
        }
        System.out.println(total);
    }
}

